package com.sun.hunk.hibernate.util;

import com.sun.hunk.hibernate.dao.GenericCodeDAO;
import com.sun.hunk.hibernate.domain.GenericCode;
import com.sun.hunk.util.CommonUtil;

/**
 *
 * @author sunil
 */
public class GenericCodeUtil {

    public static GenericCode getGenericCode(Long id){
        if(id != null && id > 0 ){
            return new GenericCodeDAO().findById(id);
        }else{
            return null;
        }
    }
    public static Long getGenericCodeId(GenericCode genericCode){
        if(CommonUtil.isNotNull(genericCode)){
            return genericCode.getId();
        }else{
            return null;
        }  
    }    
}
